<?php
/**
 * chaotian
 * User: 申龙彪
 * Date: 2024-01-31
 * Time: 0:35
 */

namespace app\api\controller;

use app\common\controller\Api;

class Accountissue extends Api
{
    protected $noNeedLogin = ['*'];

    public function sendAccountissue()
    {
        $data = [
            'origin_loginmobile'  => input('origin_loginmobile'),
            'issue_reason'        => input('issue_reason'),
            'current_contactinfo' => input('current_contactinfo'),
        ];

        if (empty($data['origin_loginmobile'])) {
            $this->error('原登录手机账号不能为空');
        }

        if (empty($data['issue_reason'])) {
            $this->error('请输入不能登录原因');
        }

        if (empty($data['current_contactinfo'])) {
            $this->error('请输入当前联络方式');
        }

        $model = new \app\common\model\Accountissue();
        $res = $model->save($data);

        if ($res) {
            $this->success('提交成功');
        } else {
            $this->error('提交失败');
        }
    }
}
